﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DomainBase.Attributes
{
    /// <summary>
    /// 特性是用于在运行时传递程序中的各种元素行为信息的声明性标签
    /// </summary>
    [AttributeUsage(AttributeTargets.Interface)]
    public class RabbitmqAttribute:Attribute
    {

        private SendType? SendType;

        private string ExchangeName;

        private string QueueName;

        private string RouterKey;

        public RabbitmqAttribute(string exchangeName,string queueName,string routerKey, SendType? sendType) 
        {
            this.ExchangeName = exchangeName ?? "";
            this.QueueName = queueName ?? "";
            this.RouterKey = routerKey ?? "";
            this.SendType = sendType?? SendType.GetValueOrDefault();
        }
    }

    public enum SendType:int
    { 
        Dirct,
        Fanout,
        Topic
    }
}
